

package cn.shengchao.controler;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.shengchao.examstar.mobileterminalpageconfig.acl.ports.message.MobileTerminalPageConfigDto;
import cn.shengchao.examstar.mobileterminalpageconfig.acl.ports.repositories.IMobileTerminalPageConfigRepository;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Tag(name = "页面配置")
@Slf4j
@RestController
@CrossOrigin("${project.cross-origin}")
@RequestMapping("/api/${project.version}/mobileTerminalPageConfig")
public class MobileTerminalPageConfigController {

    @Autowired
    private IMobileTerminalPageConfigRepository iMobileTerminalPageConfigRepository;

    @SaIgnore
    @Operation(summary = "获取页面配置", description = "获取页面配置")
    @GetMapping("{appid}")
    public List<MobileTerminalPageConfigDto> getList(@PathVariable String appid, @RequestParam Long index) {
        return iMobileTerminalPageConfigRepository.getOnlineListByAppidAndIndex(appid, index);
    }
}
